home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_item_fieldlight.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
2KB
|
103 lines
# Jedi Knight Cog Script
#
# ITEM_FIELDLIGHT.COG
#
# INVENTORY Script - Field Light
#
# [CYW & YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
thing player
int actorFlags
message activated
message pulse
message killed
sound lightActivate=activate04.wav
sound lightDeactivate=deactivate04.wav
end
# ========================================================================================
code
activated:
player = GetSourceRef();
actorFlags = GetActorFlags(player);
if(GetInv(player, 42))
{
if(BitTest(actorFlags, 4))
{
// Print("Field Light OFF");
jkPrintUNIString(player, 252);
ClearActorFlags(player, 4);
SetInvActivated(player, 42, 0);
PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
SetPulse(0);
}
else
{
if(GetInv(player, 13) > 0)
{
// Print("Field Light ON");
jkPrintUNIString(player, 251);
SetActorFlags(player,4);
SetInvActivated(player, 42, 1);
PlaySoundThing(lightActivate, player, 1.0, -1, -1, 0x80);
SetPulse(1.5);
}
else
{
// Print("Field Light out of power");
PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
jkPrintUNIString(player, 253);
}
}
}
Return;
# ........................................................................................
pulse:
ChangeInv(player, 13, -1);
if(GetInv(player, 13) == 0)
{
// Print("Field Light out of power");
jkPrintUNIString(player, 253);
PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
ClearActorFlags(player, 4);
SetInvActivated(player, 42, 0);
SetPulse(0);
}
Return;
# ........................................................................................
killed:
player = GetLocalPlayerThing();
if(GetSenderRef() != player) Return;
if(IsInvActivated(player, 42) == 1)
{
SetPulse(0);
ClearActorFlags(player, 4);
SetInvActivated(player, 42, 0);
}
Return;
end